﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Pong
{
    public class PaddleNoMovement:IPaddle
    {
        private Paddle paddle;
       
        
        public PaddleNoMovement(Paddle paddle)
        {
            this.paddle = paddle;
        }

        public void Update(GameTime gameTime)
        {
            if ( Input.DetectKeyDown(Keys.Up))
            {
                this.paddle.IStatePaddle = new PaddleUp(this.paddle);
            }
            else if ( Input.DetectKeyDown(Keys.Down))
            {
                this.paddle.IStatePaddle = new PaddleDown(this.paddle);
            }
            else if (Input.DetectKeyDown(Keys.Right))
            {
                this.paddle.IStatePaddle = new PaddleRight(this.paddle);
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(this.paddle.PaddleTexture,
                this.paddle.Position, this.paddle.Color );
        }
    }
}
